package com.mdx.tools.util;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap;

/**
 * @author : jiagang
 * @date : Created in 2021/7/30 10:49
 */
@Component
public class HttpHeadersService {

    public HttpEntity<MultiValueMap<String, Object>> getHttpEntityRequest(MediaType mediaType,
                                                                          MultiValueMap<String, Object> map){
        //设置请求头
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(mediaType);
        HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
        return request;
    }
}
